﻿using System;
using System.Collections.Generic;
using System.Text;

namespace gChartSharp
{
    /// <summary>
    /// 
    /// </summary>
    public class GeographicalAreaParam : IChartParam
    {
        /// <summary>
        /// The name of the API
        /// </summary>
        public string Name { get { return "chtm"; } }


        /// <summary>
        /// The geographical area
        /// </summary>
        public GeographicalArea GeographicalArea { get; set; }


        // The default constructor
        public GeographicalAreaParam() { }


        /// <summary>
        /// The only constructor
        /// </summary>
        /// <param name="geoArea"></param>
        public GeographicalAreaParam(GeographicalArea geoArea)
        {
            this.GeographicalArea = geoArea;
        }


        /// <summary>
        /// Render the API text
        /// </summary>
        /// <returns></returns>
        public string Render()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append(String.Format("&{0}={1}", this.Name, this.GeographicalArea.ToString()));
            return sb.ToString();
        }
    }

    public enum GeographicalArea
    {
        africa,
        asia,
        europe,
        middle_east,
        south_america,
        usa,
        world
    }
}
